from flask import Flask, url_for, request, redirect, render_template, \
    session,flash
from flask_sqlalchemy import SQLAlchemy
from werkzeug.utils import secure_filename
import os
import secrets
app = Flask(__name__,
            template_folder='../templates',
            static_folder='../static')
app.secret_key = str(secrets.token_hex())  # 使用session之前必须生成密钥
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:密码@127.0.0.1:3306/ibm10'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_ECHO'] = True
UPLOAD_FOLDER = 'up_to'
ALLOWED_EXTENSIONS = {'pdf', 'docx'}
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
db = SQLAlchemy(app)

from ibm import models, views